<include file="Public/header" />

<!--<include file="Public/fixed"/>-->
<style>
    .fixed{
        margin-left: -15px;
    }
</style>
<div  style="width:100px;height:100px;overflow:hidden;border-radius:100%;margin:15px auto;">
     <img src="{$person_info.photo}" style="width: 100%;">
</div>

<dov class="row">
    <div class="col-xs-12" style="text-align: center"><p style="color:#ff954f;font-size:22px">{$person_info.name}</p></div>
</dov>
<div class="row">
    <div class="col-xs-6" style="text-align: center;padding-left: inherit;"><span style="font-size: 14px;color:#666666">学院:</span><span style="color:#333333">{$person_info.academy}</span></div>
    <div class="col-xs-6" style="text-align: center;padding-left: inherit;"><span style="font-size: 14px;color:#666666">专业：</span><span style="color:#333333">{$person_info.major}</span></div>
</div>
   <!--  <div class="row">
        <div class="col-xs-1"></div>
        <div class="col-xs-10" style="margin-left:10px;width:80%;padding: 1em;margin:10px auto;border:1px #dddddd solid;text-align:center;box-shadow: 1px 1px 1px rgb(133, 129, 129)"><p>{$person_info.introduce}</p></div>
        <div class="col-xs-1"></div>
    </div> -->
    <div  style="width:80%;padding: 1em;margin:10px auto;border:1px #dddddd solid;box-shadow: 1px 1px 1px rgb(133, 129, 129)">
        <span style="font-size:22px">个人简介</span>
        <p style="line-height:24px;font-size: 14px">{$person_info.introduce}</p>
    </div>
<div class="row">
    <div class="col-xs-12" style="padding-top: 1em;text-align: right"><a href="{$link}"><button class="btn btn-warning">进入卖家店铺</button></a></div>


</div>
<div >
    <div  style="height:140px;width:100%" >
        <p style="margin:20px;font-size:22px">我来评价</p>
        <input id="content" placeholder="100字以内" style="width:90%;height:30px;margin:0 auto;display:block" type="text"/>
        <button id="publish" style="float:right;margin:20px" class="btn btn-warning">发表</button>
    </div>
    <p style="font-size: 22px;margin-left:10px;margin-bottom:10px;color:#ff9743">店铺评价(<span>{$comment_num}</span>)</p>


    <div id="com_his">
        <volist name="comment" id="co">
            <div class="container" style="border-top:1px #dddddd solid;padding:5px;border-bottom:1px #dddddd solid">
                <div style="float:left;width:40px;height:40px;border-radius:100%;overflow: hidden">
                    <img style="width:100%" src="{$co.head}" alt=""/>
                </div>
                <div style="float:right;width:85%">
                    <p style="color:#333333;margin-bottom:10px;">{$co.nickname}</p>
                    <p style="color:#666666">{$co.content}</p>
                    <span style="float:right" class="time">{$co.time}</span>
                </div>
            </div>
        </volist>

    </div>

</div>
</div>
<script src="__PUBLIC__/js/jquery.min.js"></script>
<script>
    var flag = true;
    $("#publish").on('click', function() {
        var content = $("#content").val();
        if(content.length >100) {
            alert("您输入的内容超过100字!");
            return;
        }

        if( flag == true){
            flag = false;
            $.ajax({
                url:"{:U('Comment/comment')}",
                type:"post",
                data:{
                    "content":content,
                    "store_id":{$store_id}
                },
                timeout: 10000,

                error: function(){alert('出现错误了...刷新一下试试!');},

                dataType:'json',

                success:function(data){
                    flag = true;
                    $("#content").val('');
//                    alert("回复成功!");
//                    console.log(data.status);
                    switch (data.status){
                        case 200:
                            alert(data.error);
                            var comment = "<div class='container' style='border-top:1px #dddddd solid;padding:5px;border-bottom:1px #dddddd solid'>";

                            comment+='<div style="float:left;width:40px;height:40px;border-radius:100%;overflow: hidden">';
                            comment+='<img src="'+data.head+'" alt=""/></div>';

                            comment+='<div style="float:right;width:85%">';
                            comment+='<p style="color:#333333;margin-bottom:10px;">'+data.nickname+'</p>';
                            comment+='<p style="color:#666666">'+data.content+'</p>';
                            comment+='<span style="float:right" class="time">'+data.time+'</span></div></div>'
                            $("#com_his").prepend(comment);
                            break;
                        case 403:
                            alert(data.error);
                            return false;
                            break;


                    }


                }
            })
        }

    })
</script>

<script>
    $("#slideDown").on('click',function(){
        if($(".slideUl").css('display') == 'none'){
            $(".slideUl").show();
        }else{
            $(".slideUl").hide();
        }
    })

</script>
</body>
</html>